package com.bite.order.controller;


import com.bite.product.api.ProductApi;
import com.bite.product.model.ProductInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Yun
 * @Date: 2025/6/6
 */
@RequestMapping("/feign")
@RestController
public class OpenFeignParamsController {
    @Resource
    private ProductApi productApi;

    @RequestMapping("/o1")
    public String o1(Integer id) {
        return "远程调用: " + productApi.p1(id);
    }


    @RequestMapping("/o2")
    public String o2(@RequestParam("id") Integer id, String name) {
        return productApi.p2(id, name);
    }

    @RequestMapping("/o3")
    public String o3(ProductInfo productInfo) {
        return productApi.p3(productInfo);
    }

    @RequestMapping("/o4")
    public String o4(@RequestBody ProductInfo productInfo) {
        return productApi.p4(productInfo);
    }
}
